<title>企业人员信息-增加</title>
<!-- /section:settings.box -->
<div class="row">
	<div class="col-xs-12 enterprise_personnelAdd">
		<form class="form-horizontal registerform">
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">公司：</label>
				<div class="input-group col-sm-9"><?=$model['firm_name'] ?></div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">姓名：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" name="hx_name"
							id="hx_name" value="" datatype="*" nullmsg="请输入姓名"
							placeholder="请输入姓名">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">性别：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<select class="chosen-select" datatype="*" nullmsg="请选择性别"
							id="hx_sex">
							<option value="">请选择性别</option>
							<option value="1">男</option>
							<option value="2">女</option>
						</select>
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">出生日期：</label>
				<div data-link-field="dtp_input1" data-date-format="yyyy-mm-dd"
					class="input-group date form_datetime col-sm-2 fl">
					<input type="text" id="hx_birthday" size="16"
						class="form-control col-sm-12" placeholder="请选择资质授予日期"> <span
						class="input-group-addon"> <span
						class="glyphicon glyphicon-remove"> </span></span> <span
						class="input-group-addon"> <span class="glyphicon glyphicon-th"> </span></span>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">身份证号：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" name="hx_card_number"
							id="hx_card_number" value="" datatype="*" nullmsg="请输入身份证号"
							placeholder="请输入身份证号">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">学历：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge"
							name="hx_educational_background" id="hx_educational_background"
							value="" datatype="*" nullmsg="请输入学历" placeholder="请输入电学历">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">专业：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" name="hx_profession"
							id="hx_profession" value="" datatype="*" nullmsg="请输入专业"
							placeholder="请输入专业">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">职称等级：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" name="hx_level"
							id="hx_level" value="" datatype="*" nullmsg="请输入职称等级"
							placeholder="请输入职称等级">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">职称登记：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" name="hx_job_title"
							id="hx_job_title" value="" datatype="*" nullmsg="请输入职称登记"
							placeholder="请输入职称登记">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">职称批准文号：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" name="hx_job_title_number"
							id="hx_job_title_number" value="" datatype="*"
							nullmsg="请输入职称批准文号" placeholder="请输入职称批准文号">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">备注：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<textarea class="form-control input-xlarge" id="hx_remark"
							style="min-height: 90px;" placeholder="请输入备注"></textarea>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="clearfix form-actions">
				<div class="col-md-offset-3 col-md-9">
					<button class="btn btn-info save" type="button" id="btnSubmit">
						<i class="ace-icon fa fa-check bigger-110"> </i>增加
					</button>
					&nbsp; &nbsp;
					<button class="btn" type="button">
						<i class="ace-icon glyphicon glyphicon-remove bigger-110"> </i>取消
					</button>
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">var scripts = [null, "/datetimepicker/js/bootstrap-datetimepicker.min.js",
	"/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js", null
];
var $scope = $(".enterprise_personnelAdd");
$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
	$('.js_nav_a li.open').removeClass('open')
	$('.js_nav_a li.active').removeClass('active')
	$('.form_datetime').datetimepicker({
		minView: "month", //选择日期后，不会再跳转去选择时分秒
		format: "yyyy-mm-dd", //选择日期后，文本框显示的日期格式
		language: 'zh-CN', //汉化
		autoclose: true //选择日期后自动关闭
	});
	var vform = $(".registerform").Validform({
		tiptype: 2
	});
	$("#btnSubmit").click(function() {
		if (!vform.check(false)) {
			return;
		}
		var name = $("#hx_name", $scope).val();
		var sex = $("#hx_sex", $scope).val();
		var birthday = $("#hx_birthday", $scope).val();
		var card_number = $("#hx_card_number", $scope).val();
		var educational_background = $("#hx_educational_background", $scope).val();
		var profession = $("#hx_profession", $scope).val();
		var job_title = $("#hx_job_title", $scope).val();
		var level = $("#hx_level", $scope).val();
		var job_title_number = $("#hx_job_title_number", $scope).val();
		var remark = $("#hx_remark", $scope).val();
		$.post('/enterprise/ajax_personnel_add', {
				'enterprise_id': '<?=$model['id'] ?>',
				'name': name,
				'sex': sex,
				'birthday': birthday,
				'card_number': card_number,
				'educational_background': educational_background,
				'profession': profession,
				'job_title': job_title,
				'level': level,
				'job_title_number': job_title_number,
				'remark': remark
			},
			function(data) {
				if (200 === data.status) {
					message_box.show('添加人员信息成功');
					gDialog.fClose();
					location.href = "/#enterprise/personnel";
				} else {
					message_box.show(data.data);
				}
			}, 'json');
	});
})</script>
